<?php

class Painel_Form_Estoque extends Zend_Form
{

    public function init()
    {
        $front = Zend_Controller_Front::getInstance();
        $controller = $front->getRequest()->getControllerName();
        $module = $front->getRequest()->getModuleName();
        $url = $front->getBaseUrl().'/'.$module.'/'.$controller;
        
        $this->setName('form_edt');
        
        $el = new Zend_Form_Element_Hidden('EST_ID',array('disableLoadDefaultDecorators' =>true));
        $el->addDecorators(array(array('ViewHelper'),array('Errors')))
            ->addFilter('Int');
        $this->addElement($el);
        
        $el = new Zend_Form_Element_Text('PRO_ID');
        $el->setLabel('Código');
        $el->setAttrib('class', 'form-control');
        $el->setAttrib('readonly', 'true');
        $this->addElement($el);
        
        $el = new Zend_Form_Element_Text('PRO_NOM');
        $el->setLabel('Produto');
        $el->setAttrib('class', 'form-control');
        $el->setAttrib('readonly', 'true');
        $this->addElement($el);
        
        $el = new Zend_Form_Element_Text('EST_QTDMIN');
        $el->setLabel('Quantidade mínima');
        $el->setAttrib('class', 'form-control');
        $this->addElement($el);
        
        $el = new Zend_Form_Element_Text('EST_QTDMAX');
        $el->setLabel('Quantidade máxima');
        $el->setAttrib('class', 'form-control');
        $this->addElement($el);
        
        $el = new Zend_Form_Element_Checkbox('EST_STA',array('checked'=>'checked'));
        $el->setLabel('Ativo');
        $this->addElement($el);
        
        $el = new Zend_Form_Element('br',array( 'helper'=>'formNote', 'value'=>'&nbsp;' ));
        $this->addElement($el);
        
        $btn = new Zend_Form_Element_Button('Salvar',array('disableLoadDefaultDecorators' =>true));
        $btn->setDecorators(array(array('Description', array('escape' => false, 'tag' => false))));
        $btn->setDescription('<button type="submit" class="btn btn-lg btn-success"><span class="glyphicon glyphicon-floppy-saved" aria-hidden="true"></span> Salvar</button>');
        $this->addElement($btn);
        
        $btn = new Zend_Form_Element_Button('Cancelar',array('disableLoadDefaultDecorators' =>true));
        $btn->setDecorators(array(array('Description', array('escape' => false, 'tag' => false))));
        $btn->setDescription('<a href="'.$url.'" class="btn btn-lg btn-danger"><span class="glyphicon glyphicon-floppy-remove" aria-hidden="true"></span> Cancelar</a>');
        $this->addElement($btn);
     
    }


}

